<template>
	<view class="content">
		<view class="group">
			<view class="goods">
				<view class="goods_image">
					<image :src="yxAuctionProductDto.image" mode=""></image>
				</view>
				<view class="goods_cont">
					<view class="goods_name ellipsis_2">{{yxAuctionProductDto.title}}</view>
					<view class="goods_bot">
						<view class="goods_price">
							<view class="sign iconfont">&#xe604;</view>
							<view class="price">{{datas.price}}</view>
						</view>
						<!-- <view class="goods_num">X1</view> -->
					</view>
				</view>
			</view>
		</view>
		<view class="group_confirm">
			<view class="confirm_list">
				<view class="confirm_title">付款凭证：</view>
				<view class="confirm_fr">
					<image class="confirm_pic" :src="datas.confirmVoucher" mode="" @click="preview(datas.confirmVoucher)"></image>
				</view>
			</view>
			<view class="confirm_list">
				<view class="confirm_title">付款凭证：</view>
				<view class="confirm_fr">{{datas.payType | type}}</view>
			</view>
		</view>
		
		
		
		
		<view class="bottom">
			<view class="submit" @click="sureOrder">确认收款</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				datas:{},
				id:'',
				yxAuctionProductDto:{}
			}
		},
		onLoad(options) {
			console.log(options)
			this.id = options.id;
			this.getOrderInfo()
			
		},
		filters:{
			type: function (e) {
				if (e == 1) {
					return '支付宝'
				} else if (e == 2) {
					return '微信'
				} else if (e == 3) {
					return '余额'
				} else if (e == 4) {
					return '银联'
				}
			}
		},
		methods: {
			getOrderInfo: function () {
				this.api.userSaleOrderDetail(this.id).then(res => {
					console.log(res)
					let datas = res.data;
					this.yxAuctionProductDto = res.data.yxAuctionProductDto
					this.datas = datas;
				})
			},
			
			// 确认收款
			sureOrder: function () {
				let that = this;
				that.api.sureConfirGathering(that.datas.id).then(res => {
					console.log(res)
					that.tui.toast(res.data);
					setTimeout(function () {
						uni.$emit('goTake',{msg:'页面更新'});
						uni.$emit('update',{msg:'页面更新'})
					},500)
					setTimeout(function () {
						uni.navigateBack({
							delta: 1
						});
					},1500)
				})
			},
			// 大图预览
			preview: function (confirmVoucher) {
				let imgList = confirmVoucher.split(" ");
				console.log(imgList)
				uni.previewImage({
					current:imgList[0],
					urls:imgList
				})
			}
		
			
			
			
		}
	}
</script>

<style lang="less">
	page {
		width: 100%;
		box-sizing: border-box;
		letter-spacing: 3rpx;
		font-family: PingFang SC;
		color: #140005;
		font-size: 28rpx;
		background: #FFFFFF;
	}
	.content {
		width: 100%;
		box-sizing: border-box;
	}
	
	.group {
		width: 100%;
		box-sizing: border-box;
		background: #F5F5F5;
		padding:22rpx;
		.goods {
			width: 100%;
			box-sizing: border-box;
			padding: 30rpx 0;
			display: flex;
			justify-content: space-between;
			background: #FFFFFF;
			.goods_image {
				width: 160rpx;
				height: 160rpx;
				image {
					width: 100%;
					height: 100%;
					border-radius: 16rpx;
				}
			}
			.goods_cont {
				width: calc(100% - 160rpx);
				box-sizing: border-box;
				padding-left: 20rpx;
				display: flex;
				flex-flow: column;
				justify-content: space-between;
				.goods_bot {
					width: 100%;
					box-sizing: border-box;
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 22rpx;
					color: #212121;
					.goods_price {
						display: flex;
						justify-content: flex-start;
						align-items: center;
						color: #E42221;
						.price {
							font-size: 28rpx;
						}
					}
				}
				.goods_name {
					width: 100%;
					box-sizing: border-box;
					line-height: 40rpx;
				}
			}
		}
		.freight {
			width: 100%;
			box-sizing: border-box;
			line-height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
	}
	.bottom {
		width: 100%;
		box-sizing: border-box;
		padding: 130rpx 50rpx 0 50rpx;
		.submit {
			width: 100%;
			box-sizing: border-box;
			text-align: center;
			font-size: 30rpx;
			color: #FFFFFF;
			background: #E42221;
			border-radius: 8rpx;
			line-height: 94rpx;
		}
	}
	.group_confirm {
		width: 100%;
		box-sizing: border-box;
		padding: 56rpx 40rpx;
		.confirm_list {
			width: 100%;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28rpx;
			color: #666666;
			padding-bottom: 20rpx;
			.confirm_title {
				line-height: 70rpx;
			}
			.confirm_fr {
				font-size: 30rpx;
				color: #212121;
				.confirm_pic {
					width: 146rpx;
					height: 146rpx;
					border-radius: 8rpx;
				}
			}
			
		}
	}
	
	
	
	
	

</style>
